/*
 * CEnvironment.h
 *
 *  Created on: 11 Oct 2012
 *      Author: Mario Kleinsasser
 *		Time:	19:05:35
 */

#ifndef CENVIRONMENT_H_
#define CENVIRONMENT_H_

#include "CAreaList.h"
#include "CItemCreator.h"

using namespace std;

/* environment singelton implementation */

class CEnvironment {

private:
	/* singleton of environment */
	static CEnvironment* instance;

	/* the playground */
	CAreaList *playground;

	/* M and N size of playground */
	int curM;
	int curN;

	CEnvironment(int m, int n);
	virtual ~CEnvironment();

public:
	static CEnvironment* getInstance(int m = 10, int n = 10);

	/* needed to destroy the object*/
	static void destroy();

	CAreaList* getPlayground() const {
		return playground;
	}

	/* act all method to call all act methods on all fields*/
	void actAll();

	/* Interface for N and M */
	int getM() const {
		return curM;
	}

	void setM(int m) {
		curM = m;
	}

	int getN() const {
		return curN;
	}

	void setN(int n) {
		curN = n;
	}

};

#endif /* CENVIRONMENT_H_ */
